<template>
  <div class="home">
    <van-card
      v-for="item in list"
      :key="item._id"
      :price="item.price"
      :title="item.title"
      :thumb="item.pic"
    >
      <template #footer>
        <van-button size="mini">加入购物车</van-button>
      </template>
    </van-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.$axios.get("goods.json").then((res) => {
      console.log(res);
      this.list = res.data;
    });
  },
};
</script>
